# -*- coding: utf-8 -*-
# @Time    : 2024/8/30 下午8:52
# @Author  : liujun
# @Email   : 2592730854@qq.com
# @File    : contract_details_add_product.py
# @Software: PyCharm

from selenium.webdriver.common.by import By
from pages.base_page import BasePage
from selenium.webdriver.support.select import Select

class  ContractDetailsAddProductPage(BasePage):
    """合同详情"""
    url="/crm/index.php?m=contract&a=view&id=7"
    contract_add_product_locator = (By.CSS_SELECTOR, "#right_list > ul > li:nth-child(2) > a")  # 点击添加产品
    # 备注
    notes_locator = (
    By.CSS_SELECTOR, "#dialog-product > form > table > tbody > tr:nth-child(4) > td:nth-child(2) > textarea")
    # 保存
    save_locator = (
    By.CSS_SELECTOR, "#dialog-product > form > table > tfoot > tr > th:nth-child(2) > input.btn.btn-primary")

    def click_contract_add_product(self):
        """点击添加产品"""
        self.driver.find_element(*self.contract_add_product_locator).click()
    def input_notes(self,notes):
        """输入备注"""
        self.driver.find_element(*self.notes_locator).send_keys(notes)
    def click_save(self):
        """点击保存"""
        self.driver.find_element(*self.save_locator).click()



